package com.bjqh.edu.UI.Activity.Login;

import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.WindowManager;

import com.bjqh.edu.MainActivity;
import com.bjqh.edu.R;
import com.bjqh.edu.UI.Activity.TeacherPersonal.TeacherIndexActivity;
import com.bjqh.edu.UI.Utils.SharedPrefsUtil;

public class Welcome extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //全屏
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_welcome);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                if (SharedPrefsUtil.getValue(Welcome.this,"role","").equals("1"))
                {
                    startActivity(new Intent(Welcome.this,TeacherIndexActivity.class));
                    finish();
                }
                else {
                    startActivity(new Intent(Welcome.this,MainActivity.class));
                    finish();
                }



            }
        },2000);

    }
}
